package product

import (
	"github.com/gogf/gf/v2/frame/g"
	"github.com/sagoo-cloud/sagooiot/api/v1/common"
	"github.com/sagoo-cloud/sagooiot/internal/model"
)

// GetUpgradeInfoListReq 获取数据列表
type GetUpgradeInfoListReq struct {
	g.Meta `path:"/upgrade_info/list" method:"get" summary:"获取升级列表" tags:"升级管理"`
	common.PaginationReq
}
type GetUpgradeInfoListRes struct {
	Data []GetUpgradeInfoByIdRes
	common.PaginationRes
}

// GetUpgradeInfoByIdReq 获取指定ID的数据
type GetUpgradeInfoByIdReq struct {
	g.Meta `path:"/upgrade_info/get" method:"get" summary:"获取升级" tags:"升级管理"`
	Id     int `json:"id"        description:"id" v:"required#id不能为空"`
}
type GetUpgradeInfoByIdRes struct {
	Version    string `json:"version"          description:"版本"`
	Module     string `json:"module"          description:"所属模块"`
	UpgradeUrl string `json:"upgradeUrl"          description:"升级路径"`
	CreatedAt  string `json:"createdAt"          description:"添加时间"`
	UpdatedAt  string `json:"updatedAt"          description:"更新时间"`
	Id         string `json:"id"          description:""`
	Size       string `json:"size"          description:"文件大小"`
}

// AddUpgradeInfoReq 添加数据
type AddUpgradeInfoReq struct {
	g.Meta     `path:"/upgrade_info/add" method:"post" summary:"添加升级" tags:"升级管理"`
	Size       string `json:"size"          description:"文件大小"`
	Version    string `json:"version"          description:"版本"`
	Module     string `json:"module"          description:"所属模块"`
	UpgradeUrl string `json:"upgradeUrl"          description:"升级路径"`
	CreatedAt  string `json:"createdAt"          description:"添加时间"`
	UpdatedAt  string `json:"updatedAt"          description:"更新时间"`
}
type AddUpgradeInfoRes struct{}

// EditUpgradeInfoReq 编辑数据api
type EditUpgradeInfoReq struct {
	g.Meta     `path:"/upgrade_info/edit" method:"put" summary:"编辑升级" tags:"升级管理"`
	Module     string `json:"module"          description:"所属模块"`
	UpgradeUrl string `json:"upgradeUrl"          description:"升级路径"`
	CreatedAt  string `json:"createdAt"          description:"添加时间"`
	UpdatedAt  string `json:"updatedAt"          description:"更新时间"`
	Id         string `json:"id"          description:""`
	Size       string `json:"size"          description:"文件大小"`
	Version    string `json:"version"          description:"版本"`
}
type EditUpgradeInfoRes struct{}

// DeleteUpgradeInfoReq 删除数据
type DeleteUpgradeInfoReq struct {
	g.Meta `path:"/upgrade_info/delete" method:"delete" summary:"删除升级" tags:"升级管理"`
	Ids    []int `json:"ids"        description:"ids" v:"required#ids不能为空"`
}

// GetUpgradeUrlReq  返回升级信息
type GetUpgradeUrlReq struct {
	g.Meta `path:"/upgrade_info/get_one" method:"get" summary:"设备端获取升级地址" tags:"升级管理"`
}
type GetUpgradeUrlRes struct {
	model.UpgradeInfoOutput
}
type DeleteUpgradeInfoRes struct{}
